//
//  HXSettingTVC.m
//  爱鲜蜂
//
//  Created by 洪东恒 on 16/5/26.
//  Copyright © 2016年 建国. All rights reserved.
//

#import "HXSettingTVC.h"
#import "HDHFileManager.h"

@interface HXSettingTVC ()
@property (weak, nonatomic) IBOutlet UILabel *fileSetting;

@end

@implementation HXSettingTVC

- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationItem.title = @"设置";
    
    NSString *filePath = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES)[0];
    self.fileSetting.text = [HDHFileManager getDirectorySize:filePath];

}

- (IBAction)settingClick {
    
    //点击cell的时候清除缓存
    //遍历文件下的一级文件
    NSString *filePath = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES)[0];
    //使用分类  先确定文件夹路径
    [HDHFileManager removeDirectoryPath:filePath];
    
    //刷新表格
//    [self.tableView reloadData];
    self.fileSetting.text = @"0.0M";
}

@end
